<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<ul id="example-1">
    <li v-on:click="add">add</li>
    <li v-for="item in items">
        {{ item.message }}
    </li>
    <goods>asdfasdf</goods>
</ul>

<script src="goods.js"></script>
<script>

    var example1 = new Vue({
        el: '#example-1',
        data: {
            items: [
                { message: 'Foo' },
                { message: 'Bar' }
            ]
        },
        methods: {
            add: function () {
                this.items.push({message:'aaaaa'});
                getdata();
            }
        }
    })
    function getdata() {
        alert();
        var url = 'https://weisys.ttyoucai.cn/app/index.php?i=2&c=entry&a=wxapp&do=api&m=ttyc&r=goods.catalog';
        api.ajax({
            url: url,
            method: 'post',
            data: {
            }
        }, function(ret, err) {
            if (ret) {
                api.alert({ msg: JSON.stringify(ret) });
            } else {
                api.alert({ msg: JSON.stringify(err) });
            }
        });

    }
</script>
</body>
</html>